package stat
Import Path
github.com/K-Phoen/grabana/stat (on go.dev)
Dependency Relation
imports 9 packages, and imported by one package
Involved Source Files
stat.go
Package-Level Type Names (total 8)
Option represents an option that can be used to configure a stat panel.
func AbsoluteThresholds(steps []ThresholdStep) Option
func ColorBackground() Option
func ColorNone() Option
func ColorScheme(options ...scheme.Option) Option
func ColorValue() Option
func DataSource(source string) Option
func Decimals(count int) Option
func Description(content string) Option
func Height(height string) Option
func Links(panelLinks ...links.Link) Option
func NoValue(text string) Option
func Orientation(mode OrientationMode) Option
func RelativeThresholds(steps []ThresholdStep) Option
func Repeat(repeat string) Option
func RepeatDirection(direction sdk.RepeatDirection) Option
func Span(span float32) Option
func SparkLine() Option
func SparkLineYMax(value float64) Option
func SparkLineYMin(value float64) Option
func Text(mode TextMode) Option
func TitleFontSize(size int) Option
func Transparent() Option
func Unit(unit string) Option
func ValueFontSize(size int) Option
func ValueType(valueType ReductionType) Option
func WithGraphiteTarget(query string, options ...graphite.Option) Option
func WithInfluxDBTarget(query string, options ...influxdb.Option) Option
func WithPrometheusTarget(query string, options ...prometheus.Option) Option
func WithStackdriverTarget(target *stackdriver.Stackdriver) Option
func New(title string, options ...Option) (*Stat, error)
func github.com/K-Phoen/grabana/row.WithStat(title string, options ...Option) row.Option
OrientationMode controls the layout.
func Orientation(mode OrientationMode) Option
const OrientationAuto
const OrientationHorizontal
const OrientationVertical
ReductionType lets you set the function that your entire query is reduced into a
single value with.
func ValueType(valueType ReductionType) Option
const Avg
const Count
const First
const FirstNonNull
const Last
const LastNonNull
const Max
const Min
const Range
const Total
Stat represents a stat panel.
Builder *sdk.Panel
func New(title string, options ...Option) (*Stat, error)
TextMode controls if name and value is displayed or just name.
func Text(mode TextMode) Option
const TextAuto
const TextName
const TextNone
const TextValue
const TextValueAndName
Color string
Value *float64
func AbsoluteThresholds(steps []ThresholdStep) Option
func RelativeThresholds(steps []ThresholdStep) Option
Package-Level Functions (total 30)
AbsoluteThresholds changes the background and value colors dynamically within the
panel, depending on the value. The threshold is defined by a series of steps
values which, each having a value and an associated color.
ColorBackground will show the threshold's colors in the background.
ColorNone will not color the value or the background.
ColorScheme configures the color scheme.
ColorValue will show the threshold's colors on the value itself.
DataSource sets the data source to be used by the panel.
Decimals sets the number of decimals that should be displayed.
Description annotates the current visualization with a human-readable description.
Height sets the height of the panel, in pixels. Example: "400px".
Links adds links to be displayed on this panel.
New creates a new stat panel.
NoValue defines what to show when there is no value.
Orientation changes the orientation of the layout.
RelativeThresholds changes the background and value colors dynamically within the
panel, depending on the value. The threshold is defined by a series of steps
values which, each having a value defined as a percentage and an associated color.
Repeat configures repeating a panel for a variable
RepeatDirection configures repeating vertical or horizontal
Span sets the width of the panel, in grid units. Should be a positive
number between 1 and 12. Example: 6.
SparkLine displays the spark line summary of the series in addition to the
stat.
SparkLineYMax defines the largest value expected on the Y axis of the spark line.
SparkLineYMin defines the smallest value expected on the Y axis of the spark line.
Text indicates if name and value is displayed or just name.
TitleFontSize sets the font size used to display the title.
Transparent makes the background transparent.
Unit sets the unit of the data displayed on this axis.
ValueFontSize sets the font size used to display the value.
ValueType configures how the series will be reduced to a single value.
WithGraphiteTarget adds a Graphite target to the graph.
WithInfluxDBTarget adds an InfluxDB target to the graph.
WithPrometheusTarget adds a prometheus query to the graph.
WithStackdriverTarget adds a stackdriver query to the graph.
Package-Level Constants (total 18)
Avg displays the average of the series.
Count displays the number of value in the series.
First displays the first value of the series.
FirstNonNull displays the first non-null value of the series.
Last displays the last value of the series.
LastNonNull displays the last non-null value of the series.
Max displays the largest value of the series.
Min displays the smallest value of the series.
const OrientationAuto OrientationMode = "" const OrientationHorizontal OrientationMode = "horizontal" const OrientationVertical OrientationMode = "vertical"
Range displays the difference between the minimum and maximum values.
const TextValueAndName TextMode = "value_and_name"
Total displays the sum of values in the series.
![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |